"use client"
import { configureStore } from "@reduxjs/toolkit";
import { useDispatch, useSelector } from "react-redux";
import userReducer from "./modules/usersStore";
import themeReducer from "./modules/ThemeStore";
import routeReducer from "./modules/routerStore";
import reacrtDndReducer from "./modules/reactdndStore";
import dictReducer from "./modules/dictStore";





const store = configureStore({
    reducer: {
        users: userReducer,
        theme: themeReducer,
        route: routeReducer,
        reactDnd: reacrtDndReducer,
        dict: dictReducer,
    }
})
export default store
// ✅ 正确声明 AppDispatch 类型
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;

// ✅ 创建支持 Thunk 的 useAppDispatch
export const useAppDispatch = () => useDispatch<AppDispatch>();